package rss2;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

public class web_reader {

	static StringBuilder text = new StringBuilder();

	public static void main(String[] args) {

		try {
			//String myURL = "http://www.yahoo.com";
			String myURL = "http://www.ebookshare.net/web-development/Web-Accessibility-2008-RETAiL-eBOOk-rebOOk-12087.html";
			URL page = new URL(myURL);
			HttpURLConnection conn = (HttpURLConnection) page.openConnection();
			conn.connect();

			// Connect to the CONTENT and setup a BufferedReader for it.
			InputStreamReader in = new InputStreamReader((InputStream) conn.getContent());
			BufferedReader read = new BufferedReader(in);

			// Now actually read the HTML
			String line;
			do {
				line = read.readLine();
				if (line != null)
					text.append(line + "\n");
			} while (line != null);

			System.out.println(text.toString());

		} catch (IOException e) {
			System.err.print("Error - :" + e.getMessage());
		}

	}
}